import { createRouter, createWebHistory } from 'vue-router'
import index from '@/views/index/index.vue'
import layout from '@/views/Layout.vue'
import personal from '@/views/personal.vue'
import login from '@/views/login.vue'
import register from '@/views/register.vue'
import adminjiedan from '@/views/admin/adminjiedan.vue'
import adminJubao from '@/views/admin/adminJubao.vue'
import adminLiuyan from '@/views/admin/adminLiuyan.vue'
import adminOrder from '@/views/admin/adminOrder.vue'
import adminWeixiu from '@/views/admin/adminWeixiu.vue'
import adminUserweixiu from '@/views/admin/adminUserweixiu.vue'
import adminweixiuList from '@/views/admin/adminweixiuList.vue'
import adminWeixiuType from '@/views/admin/adminWeixiuType.vue'
import gonggao from '@/views/admin/gonggao.vue'
import userList from '@/views/admin/userList.vue'
import workerJiedan from '@/views/gongren/workerJiedan.vue'
import workerJubao from '@/views/gongren/workerJubao.vue'
import workerOrder from '@/views/gongren/workerOrder.vue'
import userJiedan from '@/views/user/userJiedan.vue'
import userJubao from '@/views/user/userJubao.vue'
import userOrderList from '@/views/user/userOrderList.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: index,
    },
    {
      path: '/login',
      name: 'login',
      component: login,
    },{
      path: '/register',
      name: 'register',
      component: register,
    },
    {
      path: '/home',
      name: 'home',
      component: layout,
      children:[
        {
          path: '/adminjiedan',
          name: 'adminjiedan',
          component: adminjiedan,
        },
        {path: '/personal',name: 'personal',component: personal}, // 个人中心
        {path: '/adminJubao',name: 'adminJubao',component: adminJubao},  // 举报管理
        {path: '/adminLiuyan',name: 'adminLiuyan',component: adminLiuyan}, // 留言管理
        {path: '/adminOrder',name: 'adminOrder',component: adminOrder}, // 维修订单管理
        {path: '/adminWeixiu',name: 'adminWeixiu',component: adminWeixiu}, // 用户维修记录
        {path: '/adminUserweixiu',name: 'adminUserweixiu',component: adminUserweixiu}, // 维修人员管理
        {path: '/adminweixiuList',name: 'adminweixiuList',component: adminweixiuList}, // 待处理维修
        {path: '/adminWeixiuType',name: 'adminWeixiuType',component: adminWeixiuType}, // 维修种类管理
        {path: '/gonggao',name: 'gonggao',component: gonggao}, // 公告管理
        {path: '/userList',name: 'userList',component: userList}, // 住户管理
        {path: '/workerJiedan',name: 'workerJiedan',component: workerJiedan},
        {path: '/workerJubao',name: 'workerJubao',component: workerJubao},
        {path: '/workerOrder',name: 'workerOrder',component: workerOrder},
        {path: '/userJiedan',name: 'userJiedan',component: userJiedan},
        {path: '/userJubao',name: 'userJubao',component: userJubao},
        {path: '/userOrderList',name: 'userOrderList',component: userOrderList},
      ]
    }
  ],
})

export default router
